home *** CD-ROM | disk | FTP | other *** search
- tell application "QuickTime Player"
- activate
-
- try
- if not (exists movie 1) then error "No movies are open."
-
- stop every movie
-
- -- CHECK FOR THE CORRECT VERSION OF QUICKTIME
- set the QT_version to (the QuickTime version as string)
- set the player_version to (the version as string)
- set the required_version to "5.0.2"
- if (the QT_version is less than the required_version) or ¬
- (the player_version is less than the required_version) then
- set the error_message to "This script requires QuickTime " & the required_version & " or greater." & ¬
- return & return & ¬
- "Current QuickTime Version: " & QT_version & return & ¬
- "Current QuickTime Player Version: " & player_version
- my upgrade_QT(error_message)
- end if
-
- -- CHECK FOR QUICKTIME PRO
- if QuickTime Pro installed is false then
- set the error_message to "This script requires a QuickTime Pro installation on this system."
- my upgrade_QT(error_message)
- end if
-
- tell movie 1
-
- -- SCRIPT STATEMENTS GO HERE
-
- end tell
- on error error_message number error_number
- if the error_number is not -128 then
- beep
- display dialog error_message buttons {"Cancel"} default button 1
- end if
- end try
- end tell
-
- on upgrade_QT(passed_message)
- tell application "QuickTime Player"
- activate
- stop every movie
- set the target_URL to "http://www.apple.com/quicktime/download/"
- display dialog passed_message & return & return & ¬
- "If this computer is currently connected to the Internet, " & ¬
- "click the “Upgrade” button to visit the QuickTime Website." buttons {"Upgrade", "Cancel"} default button 2
- ignoring application responses
- tell application "Finder"
- open location target_URL
- end tell
- end ignoring
- error number -128
- end tell
- end upgrade_QT
-